package com.hyh.shiyanshiguanli.mapper;

import com.hyh.shiyanshiguanli.domain.dto.LibAddDTO;
import com.hyh.shiyanshiguanli.domain.dto.LibDTO;
import com.hyh.shiyanshiguanli.domain.dto.LibUpdateDTO;
import com.hyh.shiyanshiguanli.domain.entity.Lib;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @author hyh
 * @version 1.0
 */
@Mapper
public interface LibMapper {


    List<Lib> page(LibDTO libDTO);

    @Insert("insert into lib_manager (username, name, password, image, phone, email) " +
            "values (#{username},#{name},#{password},#{image},#{phone},#{email})")
    void add(LibAddDTO libAddDTO);

    @Select("select * from lib_manager where id = #{id}")
    Lib selectById(@Param("id") Integer id);

    void updateById(LibUpdateDTO libUpdateDTO);

    @Delete("delete from lib_manager where id = #{id}")
    void deleteById(@Param("id") Integer id);
}
